// app/api/tasks/route.ts
// 必须要大写，已验证
export async function GET() {
  return Response.json({
    code: 200,
    message: "调用获取用户信息接口",
    data: Array.from({ length: 10 }).map((item, index) => ({
      index,
      name: `name${index + 1}`,
    })),
  });
}

export async function POST(request: Request) {
  const data = await request.json();
  return Response.json({ receivedData: data }, { status: 201 });
}

export async function DELETE() {
  return Response.json({ tasks: ["Task 1", "Task 2"] });
}
